package seo.dale.swagger.product.controller;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import seo.dale.swagger.book.dao.DAO;
import seo.dale.swagger.book.model.Book;
import seo.dale.swagger.book.status.OperationResult;

import com.wordnik.swagger.annotations.*;

@Controller
@RequestMapping(value = "/products")
public class ProductController {

	@Autowired
	private DAO<Book, String> bookDAO;

	@ApiOperation(value = "Lists all the books in the database")
	@RequestMapping(method = RequestMethod.GET)
	public @ResponseBody List<Book> list() {
		return bookDAO.findAll();
	}

}
